﻿#region Copyright

// All Material Copyright © 2010 Dynamic Concepts Development Corp., All Rights Reserved.
//      Portions Copyright © 1984-2009 Dynamic Concepts Development Corp., All Rights Reserved.
// For further information please contact: SoftwareSupport@dynconcepts.com
// Dynamic Concepts Development Corp.  311 W 57th St. Suite #422, New York, NY 10019

#endregion

#region Using References

using System;

#endregion

namespace DynConDevCorp.OpenArch.SupportLibrary.ParallelExecution.Scheduling
{
    internal class ScheduledExecutionEnvironmentEventArgs : EventArgs
    {
        #region Constructors

        internal ScheduledExecutionEnvironmentEventArgs(ScheduledExecutionEnvironmentDelegate action, object context)
        {
            r_Action = action;
            r_Context = context;
        }

        #endregion

        #region Internal Properties and Indexers

        internal Delegate Action
        {
            get { return r_Action; }
        }

        internal object Context
        {
            get { return r_Context; }
        }

        #endregion

        #region Internal Methods

        internal void ExecuteAction()
        {
            if (r_Action != null)
            {
                r_Action(r_Context);
            }
        }

        #endregion

        #region Instance Fields (ReadOnly)

        private readonly ScheduledExecutionEnvironmentDelegate r_Action;
        private readonly object r_Context;

        #endregion
    }
}